package com.jinniulive.platform.tools;

/**
 * Created by Administrator on 2016/12/9.
 *  sto=@"<font style='font-size:14px; color:#8b8b8b;font-family:宋体;'> 对 </font>";
 sYou=@"<font style='font-size:14px; color:#ffb100; font-family:宋体;'>您</font>";
 ssay=@"<font style='font-size:14px; color:#8b8b8b; font-family:宋体;'> 说：</font>";
 sAll=@"<font style='font-size:14px; color:#ffb100;font-family:宋体;'>大家</font>";
 sSend=@"<font style='font-size:14px; color:#8b8b8b;font-family:宋体;'>送给</font>";
 sGe=@"<font style='font-size:14px; color:#8b8b8b;font-family:宋体;'>个</font>";
 */

public class HtmlFormat {
    private static String sto="<font style='font-size:14px; color:#8b8b8b;font-family:宋体;'> 对 </font>";
    private static String sYou="<font style='font-size:14px; color:#ffb100; font-family:宋体;'>您</font>";
    private static String ssay="<font style='font-size:14px; color:#8b8b8b; font-family:宋体;'> 说：</font>";
    private static String sAll="<font style='font-size:14px; color:#ffb100;font-family:宋体;'>大家</font>";
    private static String sSend="<font style='font-size:14px; color:#8b8b8b;font-family:宋体;'>送给</font>";
    private static String sGe="<font style='font-size:14px; color:#8b8b8b;font-family:宋体;'>个</font>";
    public static String FormatPublicChat(int senderid,String senderName,int reciverID,String
            reciverName,String ChatMsg,int identifier){
        String sender = String.format("<font style='font-size:14px; color:#ffb100; font-family:宋体;'>%s</font>", senderName);
        String reciver = String.format("<font style='font-size:14px; color:#ffb100; font-family:宋体;'>%s</font>", reciverName);

        String send= null;
        String recive= null;
        if (identifier==0) {
            //xx对xx说
            send=sender;
            recive=reciver;
        }if (identifier==1) {
            //您对xx说
            send=sYou;
            recive=reciver;
        }if (identifier==2) {
            //xx对您说
            send=sender;
            recive=sYou;
        }
        String sinfo= String.format("<div style ='margin:7px 0px 0px 0px;'>%s%s%s%s%s</div>",send,sto,recive,ssay,ChatMsg);
        return sinfo;
    }
    public static String FormatPublicChatToAll(int senderid,String senderName,String ChatMsg,int identifier){
        String sender=String.format(" <font style='font-size:14px; color:#ffb100; font-family:宋体;'>%s</font>",senderName);

        String send=null;

        if (identifier==1) {
            //您对大家说
            send=sYou;
        }else {
            //xx对大家说
            send=sender;
        }
        String sinfo=String.format("<div style ='margin:7px 0px 0px 0px;'>%s%s%s%s%s</div>",send,sto,sAll,ssay,ChatMsg);

        return sinfo;
    }


}
